# coding=utf-8
"""
Time:2024/11/7 14:20
"""
import sys
sys.path.append('..')
import requests

class Send_Requests(object):
    '''
    封装一个发送接口请求的封装类
    '''
    def __init__(self):
        self.session = requests.session()

    def send(self,method,url,data=None,json=None,params=None,headers=None):
        method = method.lower()
        if method == 'get':
            response = self.session.get(url,params)
        elif method == "post":
            response = self.session.post(url,data,headers)
        elif method == "post_json":
            response = self.session.post(url, json, headers)
        elif method == "delete":
            response = self.session.delete(url)
        return response